<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>SwitchAssembly.swift - Slather</title>
<link href="slather.css" media="all" rel="stylesheet">
</head>
<body>
<header><div class="row"><a href="index.html"><img src="logo.jpg" alt="Slather logo"></a></div></header><div class="row"><div id="reports">
<h2 class="cov_title">
<span>Coverage for "SwitchAssembly.swift" : </span><span class="cov_high">100.00%</span>
</h2>
<h4 class="cov_subtitle">(70 of 70 relevant lines covered)</h4>
<h4 class="cov_filepath">RouteComposer/Classes/Assemblies/SwitchAssembly.swift</h4>
<table class="source_code">
<tr class="never">
<td class="num">1</td>
<td class="src"><pre><code class="objc">//</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">2</td>
<td class="src"><pre><code class="objc">// RouteComposer</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">3</td>
<td class="src"><pre><code class="objc">// SwitchAssembly.swift</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">4</td>
<td class="src"><pre><code class="objc">// https://github.com/ekazaev/route-composer</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">5</td>
<td class="src"><pre><code class="objc">//</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">6</td>
<td class="src"><pre><code class="objc">// Created by Eugene Kazaev in 2018-2022.</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">7</td>
<td class="src"><pre><code class="objc">// Distributed under the MIT license.</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">8</td>
<td class="src"><pre><code class="objc">//</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">9</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">10</td>
<td class="src"><pre><code class="objc">import Foundation</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">11</td>
<td class="src"><pre><code class="objc">import UIKit</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">12</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">13</td>
<td class="src"><pre><code class="objc">/// Builds a `DestinationStep` which can contain the conditions to select the steps to be taken by a `Router`.</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">14</td>
<td class="src"><pre><code class="objc">/// ### Usage</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">15</td>
<td class="src"><pre><code class="objc">/// ```swift</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">16</td>
<td class="src"><pre><code class="objc">///        let containerStep = SwitchAssembly&lt;UINavigationController, ProductContext&gt;()</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">17</td>
<td class="src"><pre><code class="objc">///                .addCase { (context: ProductContext) in</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">18</td>
<td class="src"><pre><code class="objc">///                    // If this configuration is requested by a Universal Link (productURL != nil), skip this case otherwise.</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">19</td>
<td class="src"><pre><code class="objc">///                    guard context.productURL != nil else {</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">20</td>
<td class="src"><pre><code class="objc">///                        return nil</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">21</td>
<td class="src"><pre><code class="objc">///                    }</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">22</td>
<td class="src"><pre><code class="objc">///</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">23</td>
<td class="src"><pre><code class="objc">///                    return ChainAssembly.from(NavigationControllerStep&lt;UINavigationController, ProductContext&gt;())</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">24</td>
<td class="src"><pre><code class="objc">///                            .using(GeneralAction.presentModally())</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">25</td>
<td class="src"><pre><code class="objc">///                            .from(GeneralStep.current())</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">26</td>
<td class="src"><pre><code class="objc">///                            .assemble()</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">27</td>
<td class="src"><pre><code class="objc">///</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">28</td>
<td class="src"><pre><code class="objc">///                }</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">29</td>
<td class="src"><pre><code class="objc">///</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">30</td>
<td class="src"><pre><code class="objc">///                // If UINavigationController is visible on the screen - use it</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">31</td>
<td class="src"><pre><code class="objc">///                .addCase(from: ClassFinder&lt;UINavigationController, ProductContext&gt;(options: .currentVisibleOnly))</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">32</td>
<td class="src"><pre><code class="objc">///</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">33</td>
<td class="src"><pre><code class="objc">///                // Otherwise - create a UINavigationController and present modally</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">34</td>
<td class="src"><pre><code class="objc">///                .assemble(default: ChainAssembly.from(NavigationControllerStep&lt;UINavigationController, ProductContext&gt;())</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">35</td>
<td class="src"><pre><code class="objc">///                    .using(GeneralAction.presentModally())</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">36</td>
<td class="src"><pre><code class="objc">///                    .from(GeneralStep.current())</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">37</td>
<td class="src"><pre><code class="objc">///                    .assemble())</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">38</td>
<td class="src"><pre><code class="objc">/// ```</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">39</td>
<td class="src"><pre><code class="objc">public final class SwitchAssembly&lt;ViewController: UIViewController, Context&gt; {</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">40</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">41</td>
<td class="src"><pre><code class="objc">    // MARK: Internal entities</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">42</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">43</td>
<td class="src"><pre><code class="objc">    private struct BlockResolver: StepCaseResolver {</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">44</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">45</td>
<td class="src"><pre><code class="objc">        let resolverBlock: (_: Context) -&gt; DestinationStep&lt;ViewController, Context&gt;?</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">46</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="covered">
<td class="num">47</td>
<td class="src"><pre><code class="objc">        init(resolverBlock: @escaping ((_: Context) -&gt; DestinationStep&lt;ViewController, Context&gt;?)) {</code></pre></td>
<td class="coverage">19x</td>
</tr>
<tr class="covered">
<td class="num">48</td>
<td class="src"><pre><code class="objc">            self.resolverBlock = resolverBlock</code></pre></td>
<td class="coverage">19x</td>
</tr>
<tr class="covered">
<td class="num">49</td>
<td class="src"><pre><code class="objc">        }</code></pre></td>
<td class="coverage">19x</td>
</tr>
<tr class="never">
<td class="num">50</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="covered">
<td class="num">51</td>
<td class="src"><pre><code class="objc">        func resolve&lt;C&gt;(with context: C) -&gt; RoutingStep? {</code></pre></td>
<td class="coverage">18x</td>
</tr>
<tr class="covered">
<td class="num">52</td>
<td class="src"><pre><code class="objc">            guard let typedContext = context as? Context else {</code></pre></td>
<td class="coverage">18x</td>
</tr>
<tr class="covered">
<td class="num">53</td>
<td class="src"><pre><code class="objc">                return nil</code></pre></td>
<td class="coverage">1x</td>
</tr>
<tr class="covered">
<td class="num">54</td>
<td class="src"><pre><code class="objc">            }</code></pre></td>
<td class="coverage">17x</td>
</tr>
<tr class="covered">
<td class="num">55</td>
<td class="src"><pre><code class="objc">            return resolverBlock(typedContext)</code></pre></td>
<td class="coverage">17x</td>
</tr>
<tr class="covered">
<td class="num">56</td>
<td class="src"><pre><code class="objc">        }</code></pre></td>
<td class="coverage">18x</td>
</tr>
<tr class="never">
<td class="num">57</td>
<td class="src"><pre><code class="objc">    }</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">58</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">59</td>
<td class="src"><pre><code class="objc">    private struct FinderResolver&lt;ViewController: UIViewController, Context&gt;: StepCaseResolver {</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">60</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">61</td>
<td class="src"><pre><code class="objc">        private let finder: AnyFinder?</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">62</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">63</td>
<td class="src"><pre><code class="objc">        private let step: DestinationStep&lt;ViewController, Context&gt;</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">64</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="covered">
<td class="num">65</td>
<td class="src"><pre><code class="objc">        init&lt;F: Finder&gt;(finder: F, step: DestinationStep&lt;ViewController, Context&gt;?) {</code></pre></td>
<td class="coverage">11x</td>
</tr>
<tr class="covered">
<td class="num">66</td>
<td class="src"><pre><code class="objc">            self.step = step ?? DestinationStep(GeneralStep.FinderStep(finder: finder))</code></pre></td>
<td class="coverage">11x</td>
</tr>
<tr class="covered">
<td class="num">67</td>
<td class="src"><pre><code class="objc">            self.finder = FinderBox(finder)</code></pre></td>
<td class="coverage">11x</td>
</tr>
<tr class="covered">
<td class="num">68</td>
<td class="src"><pre><code class="objc">        }</code></pre></td>
<td class="coverage">11x</td>
</tr>
<tr class="never">
<td class="num">69</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="covered">
<td class="num">70</td>
<td class="src"><pre><code class="objc">        func resolve&lt;Context&gt;(with context: Context) -&gt; RoutingStep? {</code></pre></td>
<td class="coverage">12x</td>
</tr>
<tr class="covered">
<td class="num">71</td>
<td class="src"><pre><code class="objc">            guard (try? finder?.findViewController(with: context)) != nil else {</code></pre></td>
<td class="coverage">12x</td>
</tr>
<tr class="covered">
<td class="num">72</td>
<td class="src"><pre><code class="objc">                return nil</code></pre></td>
<td class="coverage">3x</td>
</tr>
<tr class="covered">
<td class="num">73</td>
<td class="src"><pre><code class="objc">            }</code></pre></td>
<td class="coverage">9x</td>
</tr>
<tr class="covered">
<td class="num">74</td>
<td class="src"><pre><code class="objc">            return step</code></pre></td>
<td class="coverage">9x</td>
</tr>
<tr class="covered">
<td class="num">75</td>
<td class="src"><pre><code class="objc">        }</code></pre></td>
<td class="coverage">12x</td>
</tr>
<tr class="never">
<td class="num">76</td>
<td class="src"><pre><code class="objc">    }</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">77</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">78</td>
<td class="src"><pre><code class="objc">    // MARK: Properties</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">79</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="covered">
<td class="num">80</td>
<td class="src"><pre><code class="objc">    private var resolvers: [StepCaseResolver] = []</code></pre></td>
<td class="coverage">12x</td>
</tr>
<tr class="never">
<td class="num">81</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">82</td>
<td class="src"><pre><code class="objc">    // MARK: Methods</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">83</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">84</td>
<td class="src"><pre><code class="objc">    /// Constructor</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="covered">
<td class="num">85</td>
<td class="src"><pre><code class="objc">    public init() {}</code></pre></td>
<td class="coverage">12x</td>
</tr>
<tr class="never">
<td class="num">86</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">87</td>
<td class="src"><pre><code class="objc">    /// Adds a block that allows a written decision case for the `Router` in the block.</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">88</td>
<td class="src"><pre><code class="objc">    /// Returning nil from the block will mean that it has not succeeded.</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">89</td>
<td class="src"><pre><code class="objc">    ///</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">90</td>
<td class="src"><pre><code class="objc">    /// - Parameter resolverBlock: case resolver block</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="covered">
<td class="num">91</td>
<td class="src"><pre><code class="objc">    public final func addCase(_ resolverBlock: @escaping ((_: Context) -&gt; DestinationStep&lt;ViewController, Context&gt;?)) -&gt; Self {</code></pre></td>
<td class="coverage">1x</td>
</tr>
<tr class="covered">
<td class="num">92</td>
<td class="src"><pre><code class="objc">        resolvers.append(BlockResolver(resolverBlock: resolverBlock))</code></pre></td>
<td class="coverage">1x</td>
</tr>
<tr class="covered">
<td class="num">93</td>
<td class="src"><pre><code class="objc">        return self</code></pre></td>
<td class="coverage">1x</td>
</tr>
<tr class="covered">
<td class="num">94</td>
<td class="src"><pre><code class="objc">    }</code></pre></td>
<td class="coverage">1x</td>
</tr>
<tr class="never">
<td class="num">95</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">96</td>
<td class="src"><pre><code class="objc">    /// Adds a case when a view controller exists in the stack in order to make a particular `DestinationStep`.</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">97</td>
<td class="src"><pre><code class="objc">    ///</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">98</td>
<td class="src"><pre><code class="objc">    /// - Parameters:</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">99</td>
<td class="src"><pre><code class="objc">    ///   - finder: The `Finder` instance searches for a `UIViewController` in the stack</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">100</td>
<td class="src"><pre><code class="objc">    ///   - step: The `DestinationStep` is to perform if the `Finder` has been able to find a view controller in the stack. If not provided,</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">101</td>
<td class="src"><pre><code class="objc">    ///   a `UIViewController` found by the `Finder` will be considered as a view controller to start the navigation process from</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="covered">
<td class="num">102</td>
<td class="src"><pre><code class="objc">    public final func addCase&lt;F: Finder&gt;(when finder: F, from step: DestinationStep&lt;ViewController, Context&gt;) -&gt; Self where F.Context == Context {</code></pre></td>
<td class="coverage">2x</td>
</tr>
<tr class="covered">
<td class="num">103</td>
<td class="src"><pre><code class="objc">        resolvers.append(FinderResolver(finder: finder, step: step))</code></pre></td>
<td class="coverage">2x</td>
</tr>
<tr class="covered">
<td class="num">104</td>
<td class="src"><pre><code class="objc">        return self</code></pre></td>
<td class="coverage">2x</td>
</tr>
<tr class="covered">
<td class="num">105</td>
<td class="src"><pre><code class="objc">    }</code></pre></td>
<td class="coverage">2x</td>
</tr>
<tr class="never">
<td class="num">106</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">107</td>
<td class="src"><pre><code class="objc">    /// Adds a case when a certain condition is valid to use a particular `DestinationStep`.</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">108</td>
<td class="src"><pre><code class="objc">    ///</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">109</td>
<td class="src"><pre><code class="objc">    /// - Parameters:</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">110</td>
<td class="src"><pre><code class="objc">    ///   - condition: A condition to use the provided step.</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">111</td>
<td class="src"><pre><code class="objc">    ///   - step: The `DestinationStep` is to perform.</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="covered">
<td class="num">112</td>
<td class="src"><pre><code class="objc">    public final func addCase(when condition: @autoclosure @escaping () -&gt; Bool, from step: DestinationStep&lt;ViewController, Context&gt;) -&gt; Self {</code></pre></td>
<td class="coverage">1x</td>
</tr>
<tr class="covered">
<td class="num">113</td>
<td class="src"><pre><code class="objc">        resolvers.append(BlockResolver(resolverBlock: { _ in</code></pre></td>
<td class="coverage">2x</td>
</tr>
<tr class="covered">
<td class="num">114</td>
<td class="src"><pre><code class="objc">            guard condition() else {</code></pre></td>
<td class="coverage">2x</td>
</tr>
<tr class="covered">
<td class="num">115</td>
<td class="src"><pre><code class="objc">                return nil</code></pre></td>
<td class="coverage">1x</td>
</tr>
<tr class="covered">
<td class="num">116</td>
<td class="src"><pre><code class="objc">            }</code></pre></td>
<td class="coverage">1x</td>
</tr>
<tr class="covered">
<td class="num">117</td>
<td class="src"><pre><code class="objc">            return step</code></pre></td>
<td class="coverage">1x</td>
</tr>
<tr class="covered">
<td class="num">118</td>
<td class="src"><pre><code class="objc">        }))</code></pre></td>
<td class="coverage">2x</td>
</tr>
<tr class="covered">
<td class="num">119</td>
<td class="src"><pre><code class="objc">        return self</code></pre></td>
<td class="coverage">1x</td>
</tr>
<tr class="covered">
<td class="num">120</td>
<td class="src"><pre><code class="objc">    }</code></pre></td>
<td class="coverage">1x</td>
</tr>
<tr class="never">
<td class="num">121</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">122</td>
<td class="src"><pre><code class="objc">    /// Adds a case when a certain condition is valid to use a particular `DestinationStep`.</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">123</td>
<td class="src"><pre><code class="objc">    ///</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">124</td>
<td class="src"><pre><code class="objc">    /// - Parameters:</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">125</td>
<td class="src"><pre><code class="objc">    ///   - conditionBlock: A condition to use the provided step.</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">126</td>
<td class="src"><pre><code class="objc">    ///   - step: The `DestinationStep` is to perform.</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="covered">
<td class="num">127</td>
<td class="src"><pre><code class="objc">    public final func addCase(when conditionBlock: @escaping (Context) -&gt; Bool, from step: DestinationStep&lt;ViewController, Context&gt;) -&gt; Self {</code></pre></td>
<td class="coverage">8x</td>
</tr>
<tr class="covered">
<td class="num">128</td>
<td class="src"><pre><code class="objc">        resolvers.append(BlockResolver(resolverBlock: { context in</code></pre></td>
<td class="coverage">12x</td>
</tr>
<tr class="covered">
<td class="num">129</td>
<td class="src"><pre><code class="objc">            guard conditionBlock(context) else {</code></pre></td>
<td class="coverage">12x</td>
</tr>
<tr class="covered">
<td class="num">130</td>
<td class="src"><pre><code class="objc">                return nil</code></pre></td>
<td class="coverage">11x</td>
</tr>
<tr class="covered">
<td class="num">131</td>
<td class="src"><pre><code class="objc">            }</code></pre></td>
<td class="coverage">11x</td>
</tr>
<tr class="covered">
<td class="num">132</td>
<td class="src"><pre><code class="objc">            return step</code></pre></td>
<td class="coverage">1x</td>
</tr>
<tr class="covered">
<td class="num">133</td>
<td class="src"><pre><code class="objc">        }))</code></pre></td>
<td class="coverage">12x</td>
</tr>
<tr class="covered">
<td class="num">134</td>
<td class="src"><pre><code class="objc">        return self</code></pre></td>
<td class="coverage">8x</td>
</tr>
<tr class="covered">
<td class="num">135</td>
<td class="src"><pre><code class="objc">    }</code></pre></td>
<td class="coverage">8x</td>
</tr>
<tr class="never">
<td class="num">136</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">137</td>
<td class="src"><pre><code class="objc">    /// Adds a case when a view controller exists - navigation will start from the resulting view controller.</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">138</td>
<td class="src"><pre><code class="objc">    ///</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">139</td>
<td class="src"><pre><code class="objc">    /// - Parameters:</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">140</td>
<td class="src"><pre><code class="objc">    ///   - finder: The `Finder` instance is to find a `UIViewController` in the stack</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">141</td>
<td class="src"><pre><code class="objc">    ///   a `UIViewController` found by the `Finder` will be considered as a view controller to start the navigation process from</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="covered">
<td class="num">142</td>
<td class="src"><pre><code class="objc">    public final func addCase&lt;F: Finder&gt;(from finder: F) -&gt; Self where F.ViewController == ViewController, F.Context == Context {</code></pre></td>
<td class="coverage">8x</td>
</tr>
<tr class="covered">
<td class="num">143</td>
<td class="src"><pre><code class="objc">        resolvers.append(FinderResolver&lt;ViewController, Context&gt;(finder: finder, step: nil))</code></pre></td>
<td class="coverage">8x</td>
</tr>
<tr class="covered">
<td class="num">144</td>
<td class="src"><pre><code class="objc">        return self</code></pre></td>
<td class="coverage">8x</td>
</tr>
<tr class="covered">
<td class="num">145</td>
<td class="src"><pre><code class="objc">    }</code></pre></td>
<td class="coverage">8x</td>
</tr>
<tr class="never">
<td class="num">146</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">147</td>
<td class="src"><pre><code class="objc">    /// Assembles all the cases into a `DestinationStep` implementation</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">148</td>
<td class="src"><pre><code class="objc">    ///</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">149</td>
<td class="src"><pre><code class="objc">    /// - Returns: instance of a `DestinationStep`</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="covered">
<td class="num">150</td>
<td class="src"><pre><code class="objc">    public final func assemble() -&gt; DestinationStep&lt;ViewController, Context&gt; {</code></pre></td>
<td class="coverage">3x</td>
</tr>
<tr class="covered">
<td class="num">151</td>
<td class="src"><pre><code class="objc">        DestinationStep(SwitcherStep(resolvers: resolvers))</code></pre></td>
<td class="coverage">3x</td>
</tr>
<tr class="covered">
<td class="num">152</td>
<td class="src"><pre><code class="objc">    }</code></pre></td>
<td class="coverage">3x</td>
</tr>
<tr class="never">
<td class="num">153</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">154</td>
<td class="src"><pre><code class="objc">    /// Assembles all the cases in a `DestinationStep` instance and adds the default implementation, providing the step it is to perform</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">155</td>
<td class="src"><pre><code class="objc">    ///</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">156</td>
<td class="src"><pre><code class="objc">    /// - Parameter resolverBlock: default resolver block</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">157</td>
<td class="src"><pre><code class="objc">    /// - Returns: an instance of `DestinationStep`</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="covered">
<td class="num">158</td>
<td class="src"><pre><code class="objc">    public final func assemble(default resolverBlock: @escaping (() -&gt; DestinationStep&lt;ViewController, Context&gt;)) -&gt; DestinationStep&lt;ViewController, Context&gt; {</code></pre></td>
<td class="coverage">2x</td>
</tr>
<tr class="covered">
<td class="num">159</td>
<td class="src"><pre><code class="objc">        resolvers.append(BlockResolver(resolverBlock: { _ in</code></pre></td>
<td class="coverage">2x</td>
</tr>
<tr class="covered">
<td class="num">160</td>
<td class="src"><pre><code class="objc">            resolverBlock()</code></pre></td>
<td class="coverage">1x</td>
</tr>
<tr class="covered">
<td class="num">161</td>
<td class="src"><pre><code class="objc">        }))</code></pre></td>
<td class="coverage">1x</td>
</tr>
<tr class="covered">
<td class="num">162</td>
<td class="src"><pre><code class="objc">        return DestinationStep(SwitcherStep(resolvers: resolvers))</code></pre></td>
<td class="coverage">2x</td>
</tr>
<tr class="covered">
<td class="num">163</td>
<td class="src"><pre><code class="objc">    }</code></pre></td>
<td class="coverage">2x</td>
</tr>
<tr class="never">
<td class="num">164</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">165</td>
<td class="src"><pre><code class="objc">    /// Assembles all the cases in a `DestinationStep` instance and adds the default implementation, providing the step it is to perform</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">166</td>
<td class="src"><pre><code class="objc">    ///</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">167</td>
<td class="src"><pre><code class="objc">    /// - Parameter step: an instance of `DestinationStep`</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">168</td>
<td class="src"><pre><code class="objc">    /// - Returns: a final instance of `DestinationStep`</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="covered">
<td class="num">169</td>
<td class="src"><pre><code class="objc">    public final func assemble(default step: DestinationStep&lt;ViewController, Context&gt;) -&gt; DestinationStep&lt;ViewController, Context&gt; {</code></pre></td>
<td class="coverage">7x</td>
</tr>
<tr class="covered">
<td class="num">170</td>
<td class="src"><pre><code class="objc">        resolvers.append(BlockResolver(resolverBlock: { _ in</code></pre></td>
<td class="coverage">7x</td>
</tr>
<tr class="covered">
<td class="num">171</td>
<td class="src"><pre><code class="objc">            step</code></pre></td>
<td class="coverage">2x</td>
</tr>
<tr class="covered">
<td class="num">172</td>
<td class="src"><pre><code class="objc">        }))</code></pre></td>
<td class="coverage">2x</td>
</tr>
<tr class="covered">
<td class="num">173</td>
<td class="src"><pre><code class="objc">        return DestinationStep(SwitcherStep(resolvers: resolvers))</code></pre></td>
<td class="coverage">7x</td>
</tr>
<tr class="covered">
<td class="num">174</td>
<td class="src"><pre><code class="objc">    }</code></pre></td>
<td class="coverage">7x</td>
</tr>
<tr class="never">
<td class="num">175</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">176</td>
<td class="src"><pre><code class="objc">}</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">177</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">178</td>
<td class="src"><pre><code class="objc">// MARK: Methods for ContainerViewController</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">179</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">180</td>
<td class="src"><pre><code class="objc">public extension SwitchAssembly where ViewController: ContainerViewController {</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">181</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">182</td>
<td class="src"><pre><code class="objc">    /// Adds a case when a view controller exists - navigation will start from the resulting view controller.</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">183</td>
<td class="src"><pre><code class="objc">    /// This method allows to avoid view controller type check.</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">184</td>
<td class="src"><pre><code class="objc">    ///</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">185</td>
<td class="src"><pre><code class="objc">    /// - Parameters:</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">186</td>
<td class="src"><pre><code class="objc">    ///   - finder: The `Finder` instance is to find a `UIViewController` in the stack</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">187</td>
<td class="src"><pre><code class="objc">    ///   a `UIViewController` found by the `Finder` will be considered as a view controller to start the navigation process from</code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="covered">
<td class="num">188</td>
<td class="src"><pre><code class="objc">    final func addCase&lt;F: Finder&gt;(expecting finder: F) -&gt; Self where F.Context == Context {</code></pre></td>
<td class="coverage">1x</td>
</tr>
<tr class="covered">
<td class="num">189</td>
<td class="src"><pre><code class="objc">        resolvers.append(FinderResolver&lt;ViewController, Context&gt;(finder: finder, step: nil))</code></pre></td>
<td class="coverage">1x</td>
</tr>
<tr class="covered">
<td class="num">190</td>
<td class="src"><pre><code class="objc">        return self</code></pre></td>
<td class="coverage">1x</td>
</tr>
<tr class="covered">
<td class="num">191</td>
<td class="src"><pre><code class="objc">    }</code></pre></td>
<td class="coverage">1x</td>
</tr>
<tr class="never">
<td class="num">192</td>
<td class="src"><pre><code class="objc"></code></pre></td>
<td class="coverage"></td>
</tr>
<tr class="never">
<td class="num">193</td>
<td class="src"><pre><code class="objc">}</code></pre></td>
<td class="coverage"></td>
</tr>
</table>
</div></div>
<footer><div class="row">
<p><a href="https://github.com/SlatherOrg/slather">Fork me on Github</a></p>
<p>&copy; 2022 Slather</p>
</div></footer><script src="highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script>
</body>
</html>
